Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

315
Vistas
Npm "scripts": "start" run express and open url

I have this start params in package.json

"scripts": {
    "start": "node bin/www"
  },

It is running my express app when I am typing npm start.

But I want browser opened http://localhost:8081 at the same time. How can I say to start to open my local url as well?

like: "start": "node bin/www, http://localhost:8081"

So when I am typing npm satrt it runs my express app and opens the url at the same time.

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

As far as I know it's like writing a bash command:

// Windows
"start":"start http://localhost:8081 & node bin/www"

// Mac
"start":"open http://localhost:8081 && node bin/www"

// Linux
"start":"xdg-open http://localhost:8081 && node bin/www"
over 4 years ago · Santiago Trujillo Denunciar

0

For cross-platform support use open-cli.

Install it:

npm install --save-dev open-cli

Add it to your scripts:

"start": "open-cli http://localhost:8081 && node bin/www"
over 4 years ago · Santiago Trujillo Denunciar

0

You just need to use start in the right order!

"start": "npm run dev & start http://localhost:8000",

Bad

"start": "start http://localhost:8000 & npm run dev",

Good

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda